package cn.kgc.spring.factory;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author: mosin
 * @version: v1.0  2022/6/30
 * 静态工厂对象
 */
public class ConnectionStaticFactoryBean {


    public  static  Connection getConnection() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql:///java2215?serverTimezone=UTC", "root", "root");
        return  connection;
    }


}
